package cn.wsalix.biz.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.persistence.Transient;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import cn.anlaser.entity.ParentEntity;
import cn.wsalix.status.CatEnum;

@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "BIZ_CATEGORY")
@Inheritance(strategy = InheritanceType.JOINED)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@EntityListeners({ AuditingEntityListener.class })
@Data
@EqualsAndHashCode(exclude = {}, callSuper = false)
@ToString(exclude = {})
public class Category extends ParentEntity<Category> {
	/**
		 * 
		 */
	private static final long serialVersionUID = 9027885954610744145L;
	@Column(name = "NAME")
	private String name;
	@Column(name = "CODE")
	protected String code;

	private String value;

	private CatEnum status;

	private String tags;

	private String logo;

	private String headerImg;

	private String footerImg;
	@Transient
	private boolean select = false;
	/*
	 * @ManyToOne(cascade = CascadeType.MERGE, optional = true, fetch =
	 * FetchType.LAZY)
	 * 
	 * @JoinColumn(foreignKey = @ForeignKey(name = "FK_SHOP_CATEGORY"), name =
	 * "CAT_ID") private Shop shop;
	 */
}
